<template>
  <div>
    <el-switch
      style="display: float;"
      v-model="value"
      active-color="#13ce66"
      inactive-color="#ff4949"
      :active-text="fatherActive"
      :active-value="fatherActiveValue"
      :inactive-text="fatherInactive"
      :inactive-value="fatherInactiveValue"
      @change="changeValue"
    >
    </el-switch>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        value:true
      }
    },
    props:["fatherActive","fatherInactive","fatherActiveValue","fatherInactiveValue","status"],
    watch:{
      status:{
        immediate: true,
        handler(newValue){
          this.value=newValue
        },
      }
    },
    methods:{
      
      changeValue(){
        this.$emit('changeSwitch', this.value);
      }
    }
  };
</script>